#pragma once

#include "../SGD Wrappers/SGD_GraphicsManager.h"
using namespace std;
#include <vector>
#include <string>

class CTile;

class CLayer
{
friend class CWorldMap;

protected:
	//Background layer
	SGD::HTexture m_hBackGround = SGD::INVALID_HANDLE;
	//Value between 0 and 1 how quickly it scrolls
	float m_fParallaxIntensity = 1.0f;
	//Background offset
	SGD::Point m_ptLocation;
	//Texture dimensions
	SGD::Size m_szLayerSize;

	bool m_bWrap = true;

public:
	CLayer(const char* filePath, SGD::Size size, SGD::Point location = SGD::Point(0, 0), float parallax = 1.0f, bool wrap = true);
	~CLayer();

	void Render();
	void Update(float dt);

	//Accessors
	float GetParallaxIntensity() const { return m_fParallaxIntensity; }
	bool GetWrap() const { return m_bWrap; }
	SGD::Point GetLocation() const { return m_ptLocation; }
	SGD::Size GetSize() const { return m_szLayerSize; }

	//Mutators
	void SetParallaxIntensity(float parallaxIntensity) { m_fParallaxIntensity = parallaxIntensity; }
	void SetWrap(bool wrap) { m_bWrap = wrap; }
	void SetLocation(SGD::Point location) { m_ptLocation = location; }
	void SetSize(SGD::Size size) { m_szLayerSize = size; }
};

